import {MenuModel} from "/@/api/system/model/MenuModel";
import axios from "/@/utils/http/axios";
import {MethodEnum} from "/@/utils/http/axios/enum/method-enum";
import {OrgModel, OrgQueryModel} from "/@/api/system/model/OrgModel";
import {DictTypeModel} from "/@/api/system/model/DictModel";
import {UserModel} from "/@/api/system/model/UserModel";


export function listOrg(data: OrgQueryModel, callBack?: Function): Promise<OrgModel[]> {
    return axios.httpRequest("/system/org/listOrg", MethodEnum.GET, data, {callBack});
}

/**
 * 组织机构列表树
 */
export function listTreeOrg(data: OrgQueryModel, callBack?: Function): Promise<OrgModel[]> {
    return axios.httpRequest("/system/org/listTreeOrg", MethodEnum.GET, data, {callBack});
}

/**
 * 新增组织机构
 * @param callBack
 */
export function insertOrg(data: OrgModel, callBack?: Function): Promise<void> {
    return axios.httpRequest("/system/org/insertOrg", MethodEnum.POST, data, {callBack});
}

/**
 * 修改组织机构
 * @param callBack
 */
export function updateOrg(data: OrgModel, callBack?: Function): Promise<void> {
    return axios.httpRequest("/system/org/updateOrg", MethodEnum.POST, data, {callBack});
}

/**
 * 根据组织机构id删除组织
 * @param orgId
 * @param callBack
 */
export function deleteOrgByOrgId(orgId: string, callBack?: Function): Promise<void> {
    return axios.httpRequest("/system/org/deleteOrgByOrgId", MethodEnum.GET, {orgId}, {callBack});
}

/**
 * 根据组织机构id查询组织机构
 * @param orgId
 * @param callBack
 */
export function selectOrgByOrgId(orgId: string, callBack?: Function): Promise<OrgModel> {
    return axios.httpRequest("/system/org/selectOrgByOrgId", MethodEnum.GET, {orgId}, {callBack});
}